package com.etc.medical.feign;

import com.etc.common.utils.Result;
import com.etc.cure.entity.Outpatient;
import com.etc.medical.client.OutpatientClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/outpatient")
public class OutpatientFeign {

    @Resource
    private OutpatientClient outpatientClient;

    /**
     * 根据医生Id查询门诊
     */
    @RequestMapping("/queryOutpatient")
    public Result queryOutpatient(@RequestParam("docId")String docId){
        return outpatientClient.queryOutpatient(docId);
    }

    /**
     * 根据门诊Id查询门诊
     */
    @RequestMapping("/queryOutpatientByOutpatientId")
    public Result queryOutpatientByOutpatientId(@RequestParam("outPatientId")String outPatientId){
        return outpatientClient.queryOutpatientByOutpatientId(outPatientId);
    }

    /**
     * 新增门诊
     * @param outpatient
     * @return
     */
    @RequestMapping("/insertOutpatient")
    public Result insertOutpatient(@RequestBody Outpatient outpatient) {
        return outpatientClient.insertOutpatient(outpatient);
    }

    /**
     * 根据门诊id修改门诊信息
     * @param outpatient
     * @return
     */
    @RequestMapping("/updateOutpatient")
    public Result updateOutpatient(@RequestBody Outpatient outpatient){
        return outpatientClient.updateOutpatient(outpatient);
    }

}
